package com.center.biz.impl;

import com.center.api.model.EduCourse;
import com.center.api.remote.RemoteEduCourseService;
import com.center.biz.dao.EduCourseMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service(version = "1.0",interfaceClass = RemoteEduCourseService.class)
public class RemoteEduCourseServiceImpl implements RemoteEduCourseService {

    @Autowired
    private EduCourseMapper eduCourseMapper;
    @Override
    public int save(EduCourse eduCourse) {
        return this.eduCourseMapper.insertSelective(eduCourse);
    }

    @Override
    public int update(EduCourse eduCourse) {
        return this.eduCourseMapper.updateByPrimaryKey(eduCourse);
    }

    @Override
    public EduCourse getById(int id) {
        return this.eduCourseMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<EduCourse> select(EduCourse eduCourse) {
        return this.eduCourseMapper.select(eduCourse);
    }

    @Override
    public int delete(int id) {
        return this.eduCourseMapper.deleteByPrimaryKey(id);
    }
}
